package com.whw.fy.controller;

import com.whw.fy.entity.ExecutiveCondition;
import com.whw.fy.entity.Message;
import com.whw.fy.service.ExecutiveConditionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;


@Api(tags = "执行情况模块")
@RestController
@RequestMapping("/api/executiveCondition")

public class ExecutiveConditionController {

    @Resource
    private ExecutiveConditionService executiveConditionService;

    @ApiOperation(value = "添加执行情况信息")
    @PostMapping("/one")
    public Message insert(ExecutiveCondition record){
        record.setExecutiveConditionTime(new Date());
        return executiveConditionService.insert(record);
    }

    @ApiOperation(value = "删除执行情况信息")
    @DeleteMapping("/")
    public Message deleteByPrimaryKey(Integer executiveConditionId){
        return executiveConditionService.deleteByPrimaryKey(executiveConditionId);
    }

    @ApiOperation(value = "修改执行情况信息")
    @PutMapping("/")
    public Message update(ExecutiveCondition record){
        return executiveConditionService.updateByPrimaryKey(record);
    }

    @ApiOperation(value = "获取所有执行情况信息")
    @GetMapping("/all")
    public Message selectAll(){
        return executiveConditionService.selectAll();
    }

    @ApiOperation(value = "根据执行情况id获取执行情况")
    @GetMapping("/one")
    public Message selectByPrimaryKey(Integer executiveConditionId){
        return executiveConditionService.selectByPrimaryKey(executiveConditionId);
    }




}
